﻿<!DOCTYPE html>
<html ng-app="demoApp" lang="en">
<head>
    <title id='Description'>In this demo is demonstrated how to change the DropDown's alignment.
    </title>
    <meta name="description" content="AngularJS DropDownList example. This example demonstrates a DropDownList with customizable Dropdown alignment." /> 
    <link rel="stylesheet" href="../../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="../../../scripts/angular.min.js"></script>
    <script type="text/javascript" src="../../../scripts/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../../scripts/demos.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/jqxdata.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/jqxlistbox.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/jqxdropdownlist.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/jqxangular.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/jqxradiobutton.js"></script>
    <script type="text/javascript">
        var demoApp = angular.module("demoApp", ["jqwidgets"]);
        demoApp.controller("demoController", function ($scope) {
            var url = "../../sampledata/customers.txt";

            // prepare the data
            var source =
            {
                dataType: "json",
                dataFields: [
                    { name: 'CompanyName' },
                    { name: 'ContactName' }
                ],
                id: 'id',
                url: url,
                async: false
            };
            var dataAdapter = new $.jqx.dataAdapter(source);
            // Create a AngularJS DropDownList
            $scope.settings = { selectedIndex: 0, source: dataAdapter, dropDownHorizontalAlignment: 'left', displayMember: "ContactName", valueMember: "CompanyName", dropDownWidth: 200, width: 150, height: 25 };
            $scope.rightChecked = function (event) {
                $scope.settings.dropDownHorizontalAlignment = "right";
            }

            $scope.leftChecked = function (event) {
                $scope.settings.dropDownHorizontalAlignment = "left";
            };
        });
    </script>
</head>
<body ng-controller="demoController">
    <div>
        <div style="float: left; font-size: 13px; font-family: Verdana;">
            <h3>Alignment</h3>
            <jqx-radio-button jqx-checked="false" jqx-on-checked="leftChecked(event)" id='leftAlign'>
                    Left</jqx-radio-button>
            <jqx-radio-button jqx-checked="true" jqx-on-checked="rightChecked(event)" style='margin-top: 10px;'>
                    Right</jqx-radio-button>
        </div>
        <jqx-drop-down-list jqx-watch="settings.dropDownHorizontalAlignment" jqx-settings="settings" style='float: left; margin-top: 20px; margin-left: 100px;'>
            </jqx-drop-down-list>
    </div>
</body>
</html>
